package primalgorithms.list;

/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode(int x) { val = x; }
 * }
 */

public class _01DelNode {
    public static void deleteNode(ListNode node) {

        //遍历链表的方法行不通
        //所以先把待删除结点往前复制一份，然后删除node的后续
        node.val = node.next.val;
        node.next = node.next.next;
    }
}
